package com.google.code.datastructure;

public class Interval {
	private int start;
	private int end;

	public int getStart() {
		return start;
	}

	public int getEnd() {
		return end;
	}

	public Interval(int start, int end) {
		this.start = start;
		this.end = end;
	}

	public Interval(String interval) {
		String[] itvl = interval.split(",");
		this.start = Integer.parseInt(itvl[0]);
		this.end = Integer.parseInt(itvl[itvl.length - 1]);
	}

	public boolean beginWith(int pt) {
		return this.start == pt;
	}

	public boolean endWith(int pt) {
		return this.end == pt;
	}
}
